$(function() {
    $("#bzjckll_grid").datagrid({
        url: $.webPath() + "/htgl/bzjckllwh/bzjckllList",
        toolbar: '#toolbar_bzjckll',
        fitColumns: true,
        fit: true,
        rownumbers: true,
        pageNumber: 1,
        pagination: true,
        singleSelect: true,
        columns: [
            [
                {field: 'gs_jc', title: "园区", width: 150,align:"center"},
                {field: 'rq', title: "保证金存款利率更新日期", width: 150,align:"center"},
                {field: 'ckll', title: "保证金存款利率(%)", width: 90,align:"center"},
                {field: 'lastUpdated_time', title: "更新时间", width: 90,align:"center"},
                {field: 'createUser_xm', title: "操作人", width: 90,align:"center"}

            ]
        ],
        onLoadSuccess: function () {
            $("#bzjckll_sc").hide();
        },
        onSelect:function(rowIndex, rowData){
            $("#bzjckll_sc").show();
        }
    });
    $("#bzjckll_tj").click(function(){
        var win = $.window({
            title:"保证金存款利率维护",
            iconCls:'icon-add2',
            url:$.webPath() + "/htgl/bzjckllwh/bzjckll_xz",
            width:300,
            height:200,
            model:true,
            buttons:[
                {text:'确认', handler:function () {
                    $("#bzjckll_form").form("submit",{
                        success:function(data){
                            $(win).window('close');
                            var data = eval('(' + data + ')');
                            if (data.statusCode == 200){
                                $.messager.show({title:'提示框', msg:data.message, timeout:3000, showType:'slide'});
                                $("#bzjckll_grid").datagrid("reload");
                            } else {
                                $.messager.alert('提示', data.message, 'info');
                            }
                        }
                    });
                }}
            ]
        });
    });
    $("#bzjckll_sc").click(function(){
        var row = $("#bzjckll_grid").datagrid("getSelected");
        $.post($.webPath() + "/htgl/bzjckllwh/delete",{"bzjckll.id":row.id},function(data){
            var data = eval('(' + data + ')');
            if (data.statusCode == 200){
                $.messager.show({title:'提示框', msg:data.message, timeout:3000, showType:'slide'});
                $("#bzjckll_grid").datagrid("reload");
            } else {
                $.messager.alert('提示', data.message, 'info');
            }
        });
    });

});